#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
int main()
{
	int n = 0;
	scanf("%d", &n);
	int* arr = (int*)malloc(sizeof(int) * n);
	int i = 0;
	int j = 0;
	for (i = 0; i < n; i++)
	{
		scanf("%d", arr + i);
	}
	int del = 0;
	scanf("%d", &del);
	int tmp = 0;
	for (i = 0; i < n; i++)
	{
		if (*(arr + i) == del)
		{
			continue;
		}
		printf("%d ", *(arr + i));
	}
	return 0;
}